<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="stylesheet" href="../../../yl/index.css" />
    <link rel="stylesheet" href="../../../style/index.css" />
    <title>项目信息</title>
    <style>
        .el-form-item__content {
            display: block;
        }
    </style>
</head>

<body>
    <div id="app" v-cloak>
        <div class="title">
            <div style="padding: 5px;">
                项目类型
                <el-select clearable v-model.trim="page.value1" placeholder="请选择项目类型" filterable style="width: 200px; margin-right: 10px;">
                    <el-option :label="item.Village_Project_Category" :value="item.Village_Project_Category_SerialNumber"
                        v-for="(item,index) in village_project_category" :key="index"></el-option>
                </el-select>
                <el-button icon="Search" style="margin: 0; margin-right: 10px;" @click="check">查询</el-button>
                <el-button icon="Refresh" style="margin: 0; margin-right: 10px;" @click="reset">重置</el-button>
<!-- 
                <el-button type="primary" icon="CirclePlus" style="margin: 0; margin-right: 10px;" @click="personalAdd"
                    plain round>添加</el-button>
                <el-button type="warning" icon="Download" style="margin: 0; margin-right: 10px;" @click="personalAdd"
                    plain round>批量导入</el-button>
                <el-button type="success" icon="Upload" style="margin: 0; margin-right: 10px;" @click="personalAdd"
                    plain round>批量导出</el-button>
                <el-button type="danger" icon="Delete" style="margin: 0; margin-right: 10px;" @click="personalAdd" plain
                    round>批量删除</el-button> -->
            </div>
        </div>
        <div class="body">
            <div class="left">
                <el-tree ref="tree" default-expand-all :expand-on-click-node="false" id="tree" style="max-width: 600px"
                    :data="treeData" @node-click="handleNodeClick" :props="{ label: 'Province' }">
                    <template #default="{ node, data }">
                        <div class="custom-tree-node">
                            <span>{{ node.label }}</span>
                        </div>
                    </template>
                </el-tree>
            </div>
            <div class="right">
                <el-tabs v-model="page.activeName" type="card" @tab-click="handleClick">
                    <el-tab-pane name="first">
                        <template #label>
                            全部
                        </template>
                    </el-tab-pane>
                    <el-tab-pane name="second">
                        <template #label>
                            待审核
                        </template>
                    </el-tab-pane>
                    <el-tab-pane name="third">
                        <template #label>
                            已通过
                        </template>
                    </el-tab-pane>
                    <el-tab-pane name="fourth">
                        <template #label>
                            已拒绝
                        </template>
                    </el-tab-pane>
                </el-tabs>
                <el-table id="table" border show-overflow-tooltip
                    :data-options="JSON.stringify({ 'TableName': 'village_project','primary_key':'Project_SerialNumber'})"
                    height="450" v-loading="loading" ref="multipleTable" tooltip-effect="dark" :data="Tabletdata"
                    @selection-change="handleSelectionChange">
                    <el-table-column min-width="180" v-for="column in columns" :key="column.COLUMN_NAME"
                        :prop="column.COLUMN_NAME" :label="column.COLUMN_COMMENT">
                        <template v-slot="{row}">
                            <div v-if="isValueType(row[column.COLUMN_NAME])=='image'">
                                <el-image style="width: 100px; height: 100px" :src="photo + row[column.COLUMN_NAME]"
                                    fit="contain"></el-image>
                            </div>
                            <div v-else>
                                {{row[column.COLUMN_NAME]}}
                            </div>
                        </template>
                    </el-table-column>
                    <el-table-column width="100" fixed="right" align="center" label="状态">
                        <template v-slot="{row}">
                            <el-tag :type="row.Row_Status=='0'?'primary':row.Row_Status=='2'?'success':row.Row_Status=='3'?'danger':'warning'">
                                {{row.Row_Status=='0'?'待审核':row.Row_Status=='2'?'已通过':row.Row_Status=='3'?'已拒绝':'已竣工'}}
                            </el-tag>
                        </template>
                    </el-table-column>
                    <el-table-column label="操作" fixed="right" width="200">
                        <template #default="{row}">
                            <div style="display: flex; align-items: center;">
                                <el-button :type="row.Row_Status != '0'? 'info' : 'success' " size="small" :disabled="row.Row_Status != '0'"
                                    @click="handlesh(row)">
                                    审核
                                </el-button>
                                <el-button :type="row.Row_Status == '2'? 'success' : 'info' " size="small" :disabled="row.Row_Status != '2'"
                                    @click="handlejugong(row)">
                                    竣工
                                </el-button>

                                <el-button :type="success" size="small" @click="handleShow(row)">
                                    查看
                                </el-button>
                                
                                <!-- <el-button :disabled="row.Project_Status!='3'" size="small"
                                    @click="handleEdit(row)">
                                    拒绝
                                </el-button> -->
                                <!-- <el-dropdown trigger="click">
                                    <el-button size="small">
                                        更多<el-icon class="el-icon--right"><arrow-down /></el-icon>
                                    </el-button>
                                    <template #dropdown>
                                        <el-dropdown-menu>
                                            <el-dropdown-item v-if="row.Project_Status == '1'" @click="examine(row)">
                                                审核
                                            </el-dropdown-item>
                                            <template v-if="row.Project_Status == '6'">
                                                <el-dropdown-item @click="examine1(row,'5')">
                                                    通过（竣工）
                                                </el-dropdown-item>
                                                <el-dropdown-item @click="examine1(row,'7')">
                                                    拒绝（竣工）
                                                </el-dropdown-item>
                                            </template>
                                            <el-dropdown-item v-if="row.Project_Status == '7'"
                                                @click="handleRework(row)">
                                                返工
                                            </el-dropdown-item>
                                            <el-dropdown-item @click="handleDelete(row)">
                                                删除
                                            </el-dropdown-item>
                                        </el-dropdown-menu>
                                    </template>
                                </el-dropdown> -->
                            </div>
                        </template>
                    </el-table-column>
                </el-table>
                <el-pagination style="margin-top: 1%;" :current-page="page.PageNumber" :page-size="page.RowAmount"
                    :page-sizes="[10, 100, 200, 300, 400]" layout="total, sizes, prev, pager, next, jumper"
                    :total="Total" @size-change="handleSizeChange" @current-change="handleCurrentChange" />
            </div>
        </div>
        <el-dialog v-model="showDialog" width="850" class="custom-dialog">
            <template #header>
                <div class="dialog-header">
                    <span>审核</span>
                </div>
            </template>
            <div class="dialog-content">
                <div class="table_titel">
                    <div class="titel">附件</div>
                </div>
                <el-table border height="450" tooltip-effect="dark" :data="data">
                    <el-table-column min-width="180" prop="Attachment_SerialNumber" label="附件流水号"></el-table-column>
                    <el-table-column min-width="180" prop="Attachment_Name" label="附件名称"></el-table-column>
                    <el-table-column min-width="180" prop="Attachment_URL" label="磁盘文件名"></el-table-column>
                    <el-table-column width="120" fixed="right" align="center" label="操作">
                        <template v-slot="{row}">
                            <el-button type="primary" size="small" @click="preview(row)">
                                在线预览
                            </el-button>
                            <!-- <el-button type="success" size="small" @click="download(row)">
                                下载附件
                            </el-button> -->
                        </template>
                    </el-table-column>
                </el-table>
                <div class="table_titel">
                    <div class="titel">原因</div>
                </div>
                <el-input type="textarea" :autosize="{ minRows: 5}" placeholder="请输入原因" v-model="Reason"></el-input>
            </div>
            <template #footer>
                <div class="dialog-footer">
                    <el-button @click="showDialog = false" class="cancel-btn">取消</el-button>
                    <el-button type="success" @click="sumbit(2)" class="confirm-btn">通过</el-button>
                    <el-button type="primary" @click="sumbit(3)" class="confirm-btn">拒绝</el-button>
                </div>
            </template>
        </el-dialog>
        <yl-online-preview :file-url="fileUrl" v-model="showDialog1"></yl-online-preview>
    </div>
    </div>
    <script src="../../../utils/utils.js"></script>
    <script src="../../../config/config.js"></script>
    <script src="../../../utils/mixins.js"></script>
    <script src="../../../yl/vue.js"></script>
    <script src="../../../yl/index.js"></script>
    <script src="../../../yl/zh-cn.mjs"></script>
    <script src="../../../yl/index.iife.min.js"></script>
    <script src="../../../yl/jquery.min.js"></script>
    <script src="../../../utils/jquery.cookie.js"></script>
    <script src="../../../api/request.js"></script>
    <script src="js/index.js"></script>
</body>

</html>